Binary Files Text vs. binary Direct access files fin.seekg(n); fout.seekp(n); fin.read((char*)&i,4); & - the address of a variable Describe the format of a bitmap file The three major categories How the pixels are laid out (BGR) Each row has an even multiple of 4 bytes Know your bitmap math 5 pixles wide by 10 pixles tall how may bytes are in each row? 16 how may bytes are in the image data?160 how may bytes are in the file header? 14 how may bytes are in the info header? 40 how may bytes are in the whole file? 214 Be able to tell if a file exists for reading. if(fin.fail()) string declare assign a value to a string s = “asdf”; compare length - s.length(); find a string in a string - s.find(s2); - returns the index where s2 is found in s string:: npos if it is not found get a string from the user that has white-space getline(cin,s); Structs Define struct FileHeader { char bfType[3]; unsigned int bfSize; unsigned short bfReserved1; unsigned short bfReserved2; unsigned int bfOffBits; }; User defined data type Object FileHeader variableName; Pass an object to a function By reference for efficiency sake If you do not need to change it make it a const reference Be able to access member variables of an object (be able use the .) Constructor Destructor Dynamic Memory Allocation new delete declare a pointer to any datatype Encapsulation Cohesion Coupling